#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
请完善文档
"""
__author__ = "shu2015626"

import grpc
from grpc_hello.proto import helloworld_pb2, helloworld_pb2_grpc

if __name__ == '__main__':
    # 50051是python服务端的端口，8088是go的服务端端口
    with grpc.insecure_channel("localhost:8088") as channel:  # 建立连接
        stub = helloworld_pb2_grpc.GreeterStub(channel)  # 客户端
        resp: helloworld_pb2.HelloReply = stub.SayHello(
            helloworld_pb2.HelloRequest(name="world")
        )
        print(resp.message)
